<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // && 一真则真
        console.log(1 && 2);        //2
        console.log(false && 2);    //false
        console.log(8 < 0 && 2);      //false
        console.log(0 && 2);        //0
        console.log(10 && 2);       //2
        console.log(10 && 2);       // 2
        console.log(undefined && 2);        //undefined
        console.log(undefined && 2);        //undefined
        console.log(null && 2);     //null

        console.log("-----------------------------");


        // ||   一假则假
        console.log(1 || 2);        //1
        console.log(false || 2);    //2
        console.log(8 < 0 || 2);      //2
        console.log(0 || 2);        //2
        console.log(10 || 2);       //10
        console.log(10 || 2);       // 10
        console.log(undefined || 2);        //2
        console.log(undefined || 2);        //2
        console.log(null || 2);     //2


        console.log('----------------------------');

        console.log('' - 1);        //-1    
        console.log('张安' - 1);        //NaN
        console.log(undefined - 1);     //NaN
        console.log(undefined + 1);     //NaN
        console.log(null - 1);      //-1
        console.log(null + 1);      //1
        console.log(NaN + 1);       //NaN
    </script>
</body>

</html>